package com.sakiko.audiobook.account.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.sakiko.audiobook.model.account.AccountDeductVo;
import com.sakiko.audiobook.model.account.UserAccount;

import java.math.BigDecimal;

public interface UserAccountService extends IService<UserAccount> {

    /**
     * 初始化账户金额
     * @param userId
     */
    void initAccount(Long userId);

    /**
     * 获取账户余额
     * @param userId
     * @return
     */
    BigDecimal getAvailableAmount(Long userId);

    /**
     * 检查及扣减账户余额
     * @param accountDeductVo
     * @return
     */
    Boolean checkAndDeduct(AccountDeductVo accountDeductVo);
}
